package com.sywb.chuangyebao.bean;

import java.io.Serializable;

/**
 * 评论信息
 */
public class Comment implements Serializable {

    public int comment_id;// 评论ID
    public int from_uid;// 评论者UID
    public int date_time;// 评论时间（秒）
    public String content;// 评论内容
    public int reply_count;// 回复数
    public int thumb_count;// 点赞数
    public boolean is_thumb;// 当前用户是否点赞：true=是 false=否
    public NewsOwner from_user;// 评论者用户信息

    public ChangTanTong changtantong;

    public String getReplyCount() {
        if (reply_count > 0) {
            String replyCount;
            if (reply_count >= 10000) {
                java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
                replyCount = df.format(reply_count / 10000d) + "万";
            } else {
                replyCount = String.valueOf(reply_count);
            }
            return String.format("%s回复", replyCount);
        } else {
            return "回复";
        }
    }

    public String getThumbCount() {
        if (thumb_count > 0) {
            if (thumb_count >= 10000) {
                java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
                return df.format(thumb_count / 10000d) + "万";
            } else {
                return String.valueOf(thumb_count);
            }
        } else {
            return "点赞";
        }
    }

    /**
     * comment_id : 29
     * from_uid : 780820
     * date_time : 1516618605
     * content : 大家好'
     * reply_count : 0
     * thumb_count : 10824
     * is_thumb : false
     * from_user : {"uid":780820,"nickname":"mobile_780820","name":"","avatar_s":"","avatar_l":"","avatar_hd":""}
     */

    public class ChangTanTong {
        public int project_id;
        public int company_id;
        public String btn_txt;// 在线咨询
    }


}
